/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package controllers.changePassword;

import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
import javax.faces.convert.Converter;
import javax.faces.convert.FacesConverter;

/**
 *
 * @author Ida
 */
@FacesConverter("javaclass.PasswordConverter")
public class PasswordConverter implements Converter {

    public PasswordConverter() {
    }

    @Override
    public Object getAsObject(FacesContext context, UIComponent component, String value) {
        return value.trim();
    }

    @Override
    public String getAsString(FacesContext context, UIComponent component, Object value) {
        return value.toString();
    }
}